package io.adminboot.service.impl;

import io.adminboot.domain.vo.PageVO;
import io.adminboot.entity.SysOss;
import io.adminboot.repository.extend.SysOssExtMapper;
import io.adminboot.service.SysOssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("sysOssService")
public class SysOssServiceImpl implements SysOssService {

	@Autowired
	private SysOssExtMapper mapper;
	
	@Override
	public PageVO queryPage(Integer pageNum, Integer pageSize) {
		List<SysOss> list = mapper.selectList((pageNum - 1) * pageSize, pageSize, null);
		int totalCount = mapper.count(null);
		PageVO page = new PageVO(list, totalCount, pageSize, pageNum);
		return page;
	}

	@Override
	public void insert(SysOss entity) {
		mapper.insert(entity);
	}

	@Override
	public void batchDeleteByIds(List<Long> ids) {
		mapper.batchDeleteByIds(ids);
	}
	
}
